<template>
  <div>
    <Header></Header>
    <router-view></router-view>
    <!-- 读取 $route.meta.isHidden 的值 控制显示和隐藏组件 -->
    <Footer v-show="!$route.meta.isHidden"></Footer>
  </div>
</template>

<script>

import Header from '@/components/Header'
import Footer from '@/components/Footer'
import {mapActions} from 'vuex'

export default {
  name: 'App',
  components:{
    Header,
    Footer,
  },
  mounted(){
    // 根组件挂载后 获取三级分类列表数据
    this.getCategoryList()
    // 获取banners和floors数据
    this.getBannersList()
    this.getFloorsList()
  },
  methods:{
    // 映射 actions 中的函数
    ...mapActions(['getCategoryList','getBannersList','getFloorsList']),
  }
}
</script>

<style lang="less" scoped>

</style>

